package com.hsgene.commit.domain;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.hsgene.common.util.date.TimeJsonDeserializer;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 评论点赞实体类
 *
 * @Author: wangxuefeng@hsgene.com
 * @Description:
 * @Date: Created in 11:26 2018/7/5
 * @Modified By:
 */
@Table(name = "geneshop_commit_like")
public class CommitLikeInfo implements Serializable {
    /**
     * 点赞表id
     */
    @Id
    private String id;

    /**
     * 评论id
     */
    private String commitInfoId;

    /**
     * 点赞数量
     */
    private int isUsefulCount;

    /**
     * 点赞时间
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date createTime = new Date();

    /**
     * 点赞者
     */
    private String userId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCommitInfoId() {
        return commitInfoId;
    }

    public void setCommitInfoId(String commitInfoId) {
        this.commitInfoId = commitInfoId;
    }

    public int getIsUsefulCount() {
        return isUsefulCount;
    }

    public void setIsUsefulCount(int isUsefulCount) {
        this.isUsefulCount = isUsefulCount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "CommitLikeInfo{" + "id=" + id + ", commitInfoId=" + commitInfoId + ", isUsefulCount=" + isUsefulCount +
                ", createTime=" + createTime + ", userId='" + userId + '\'' + '}';
    }
}
